<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>测速结果 | speedtest-x</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="https://lib.baomitu.com/layui/2.5.7/css/layui.css"  media="all">
  <style>
    .footer {line-height: 30px; text-align: center;}
    .footer a{padding:0 6px; font-weight: 300;}
    .footer a:hover{color: green;}
    .header {line-height: 30px; text-align: center;height:50px;padding-top:50px;margin-bottom: 10px;}
    .header span>a {color:white;}
  </style>
</head>
<body>
<div class="header">
  <h1>speedtest-x 测速结果</h1>
<span class="layui-badge layui-bg-green"><a href="./chart.html" target="_blank">查看线性图表</a></span>
  <a href="javascript:layer.tips('线性图表用于展示不同运营商在不同时段的速度表现，程序默认保留100条测速结果，可调大此数值以获得更准确的图表分析', '#tips', {
  tips: [3, '#3595CC'],
  time: 6000
});"><span id="tips" class="layui-badge layui-bg-black">?</span></a>
</div>

<table class="layui-hide" id="test"></table>

<div class="footer">
  <a href="https://github.com/BadApple9/speedtest-x" target="_blank">speedtest-x 项目地址</a>
</div>

<script src="https://lib.baomitu.com/layui/2.5.7/layui.js" charset="utf-8"></script>

<script>
    layui.use('table', function(){
        var table = layui.table;

        table.render({
            elem: '#test'
            ,url:'./backend/results-api.php'
            ,cellMinWidth: 80
            ,cols: [[
                {field:'ip', title: 'IP地址'}
                ,{field:'isp', title: '运营商'}
                ,{field:'addr', title: '城市'}
                ,{field:'dspeed', title: '下载速度 (Mbps)', sort: true, align: 'right'}
                ,{field:'uspeed', title: '上传速度 (Mbps)', sort: true, align: 'right'}
                ,{field:'ping', title: 'Ping (ms)', sort: true, align: 'right'}
                ,{field:'jitter', title: '抖动 (ms)', sort: true, align: 'right'}
                ,{field:'created', title: '测试时间', sort: true}
            ]]
        });
    });
</script>

</body>
</html>
